package teach.aistar.mapper;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import teach.aistar.model.entity.CarDetail;
import teach.aistar.model.vo.AdminCarQueryVo;

import java.util.List;

public interface CarDetailMapper {

    @Select(" select * from car_detail where c_age = #{c_age}")
    List<CarDetail> selectByAge(@Param("c_age") int c_age);

    @Select(" select * from car_detail order by id desc ")
    List<CarDetail> selectAll();

    //车辆信息插入
    int insert(CarDetail carDetail);


    //车辆信息根据主键查询
    int deleteById(Long id);

    //车辆信息多条件查询
    List<CarDetail> findByConditional(AdminCarQueryVo adminCarQueryVo);

    //根据车辆id查询信息
    @Select("select * from car_detail where id=#{id}")
    CarDetail findById(long id);

    //更新车辆信息
    int update(CarDetail carDetail);
}